﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PokerClient.VisualDisp
{
	public partial class StatTable : Form
	{
		private DataTable db;
		delegate void updateTable(DataTable db);
		public StatTable(Client myClient)
		{
			InitializeComponent();
			this.db = new DataTable();			
			myClient.sent(PokerClient.Connection.Protocols.ProtocolsRequests.requestUserStats());
		}


		public void updateFields(DataTable db)
		{
			if (this.dataGridView1.InvokeRequired)
			{
				updateTable ut = new updateTable(updateFields);
				this.dataGridView1.Invoke(ut, new object[] { db });
			}
			else
			{
				this.dataGridView1.DataSource = db;
			}
		}
		public DataTable setTable
		{
			set
			{
				updateFields(value);
			}
		}

	}
}
